import { _decorator, Component, Node, Sprite, SpriteFrame } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Prop')
export class Prop extends Component {

    @property([SpriteFrame])
    propsSp: SpriteFrame[]=[]

    propType;

    init(_propType) {
        this.propType=_propType
        switch (_propType) {
            case 0:
                this.node.getChildByName("sp").getComponent(Sprite).spriteFrame = this.propsSp[0]
                break;
            case 1:
                this.node.getChildByName("sp").getComponent(Sprite).spriteFrame = this.propsSp[1]

                break;

        }
    }

}


